#!/bin/bash
# 将119redis数据同步到121 
redis-cli -h 119.3.93.61 -p 6379 -a ysj123+= -n 0 keys "*" | while read key
do
    redis-cli -h 119.3.93.61 -p 6379 -a ysj123+= -n 0 --raw dump $key | perl -pe 'chomp if eof' | redis-cli -h 121.40.103.232 -p 6002 -a ysj123+= -n 1 -x restore $key 0
    echo "migrate key $key"
done